var member;
mui.init();
(function ($) {
    $.ready(function () {
        swiper();
        init()
    });
})(mui);

function init() {
    //获取用户信息
    $.post('/member/refresh',{'type':'wechat'}, function (data) {
        console.log(data);
        member = data.obj
        if (data.code == '10006') {
            //保存手机号
            localStorage.setItem('realName', JSON.stringify(member))
            //是否实名
            $('#realName').on('touchend', function () {
                if (member.realName !== null && member.realName !== '') {
                    openPage('/wechat/toRealName')
                } else {
                    openPage('/wechat/toRealName')
                }
            })

            //绑定了银行卡
            $('#bankCard').on('touchend', function () {
                openPage('/wechat/toBankInfo')
            })
            //修改密码
            $('#changePas').on('touchend', function () {
                openPage('/wechat/retrievePwd')
            })
            //我要借款
            $('#jiekuan').on('touchend', function () {
                openPage('/wechat/toWechatApply')
            })
            //账单
            $('#bill').on('touchend', function () {
                openPage('/wechat/toBill')
            })
        }else{
            openPage('/wechat/loginPage')
        }
    })
}
//轮播
function swiper() {
    var swiper = new Swiper('.swiper-container', {
        loop: true,
        autoplay: 2000
    })
}
